#include<stdio.h>
int main(){
	int T,b;
	int N,a[1000],i;
	int s=0,sum=0,t=0;
		scanf("%d",&T);
	for(b=0;b<T;b++){
		scanf("%d",&N);
		a[0]=0;
		for(i=1;i<=N;i++){
			scanf("%d",&a[i]);
		}
			if(N==1){
			sum=a[1]*6+5;
			printf("%d\n",sum);
			sum=0;
	     	}
			else{
			t=N*5;
			for(i=0;i<N;i++)
			s=s+((a[i]<a[i+1])?(a[i+1]-a[i])*6:(a[i]-a[i+1])*4);
			sum=t+s;
			printf("%d\n",sum);
		    s=0,t=0,sum=0;
	    	}
	} 
	return 0;
}

